class ChromeStorage {
  constructor() {
    this.storage = chrome.storage.local;
  }
  put(key, value, cb) {
    this.storage.set({ [key]: value }, cb);
  }
  /**
     * @param {string|array} key
     */
  get(key, cb) {
    return this.storage.get(key, cb);
  }
  remove(key, cb) {
    this.storage.remove(key, cb);
  }
  clear(cb) {
    this.storage.clear(cb);
  }
  getAll(cb) {
    return this.storage.get(cb);
  }
}

let chromeStorage = new ChromeStorage();

export function useChromeStorage() {
  return chromeStorage;
}

